<?php
$index = strrpos($_SERVER['SCRIPT_FILENAME'],'/');
$dir = substr ($_SERVER['SCRIPT_FILENAME'],0,$index);
$dir = str_replace($_SERVER['DOCUMENT_ROOT'],'',$dir);
include_once("libs/SmartyBC.class.php");
$smarty=new SmartyBC();
$smarty->template_dir = $_SERVER['DOCUMENT_ROOT']."/templates/";
$smarty->compile_dir = $_SERVER['DOCUMENT_ROOT'].'/templates_c'.$dir;
$smarty->cache_dir = $_SERVER['DOCUMENT_ROOT'].'/cache/'.$dir;
$smarty->left_delimiter = '{{';
$smarty->right_delimiter = '}}';
	//获取数据库类
	require_once $_SERVER['DOCUMENT_ROOT'].'/class/db.class.php';
?>